<template>
  <el-table-column
    v-for="column in columnList"
    :key="column.prop"
    :prop="column.prop"
    :label="column.label"
    :width="column.width"
    align="center"
  >
    <div v-if="column?.children?.length > 0">
      <RecursionItem :column-list="column?.children"></RecursionItem>
    </div>
    <template v-if="column.slotName" #default="scoped">
      <slot :name="column.slotName" v-bind="scoped"></slot>
    </template>
  </el-table-column>
</template>

<script setup name="RecursionItem">
defineProps({
  columnList: {
    type: Array,
    default: () => []
  }
})
</script>
